package com.spark.market.controller;

import com.spark.market.api.utils.ResponseResult;
import com.spark.market.api.utils.ResponseUtil;
import com.spark.market.common.utils.AssertUtils;
import com.spark.market.service.PromoCmdCoreService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/promo/cmd")
public class PromoCmdController extends BaseController{
    @Resource
    private PromoCmdCoreService promoCmdCoreService;

    @PostMapping("/publishPromoItem/{itemId}")
    public ResponseResult<Object> publishPromo(@PathVariable("itemId") Integer itemId){
        AssertUtils.isNotNull(itemId, "itemId is null");
        promoCmdCoreService.publishPromo(itemId);
        return ResponseUtil.createSuccessResult("null");
    }
}
